using System;
using System.Data;
using System.Data.SqlClient ;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class TreeViewPage : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        TreeView1.CollapseAll();
        TreeView1.ExpandAll();
        
    }
    protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        Label1.Text = "SelectedNodeChanged-Value: " + 
        TreeView1.SelectedValue +" Text: " 
        +  TreeView1.SelectedNode.Text;
    }

    protected void TreeView1_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
    {
        Label1.Text = "TreeNodeExpanded-Value: " +
               e.Node.Value + " Text: "
               + e.Node.Text;
    }
    protected void TreeView1_TreeNodeCollapsed(object sender, TreeNodeEventArgs e)
    {
        Label1.Text = "TreeNodeCollapsed-Value: " +
               e.Node.Value + " Text: "
               + e.Node.Text;
    }
    protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e)
    {
        Label1.Text = "TreeNodePopulate-Value: " +
                       e.Node.Value + " Text: "
                       + e.Node.Text;
    }
}
